//
// Created by PC on 2024/2/18.
// OJ:https://www.luogu.com.cn/problem/P3912 通过
//


#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int n = 100;
    //    n=10000; // 1229
    n = 1740948; // out: 130971
    n = 1152761; // out: 89503
    n=1000; //168
//    n = 2795431; // out: 203047
//    n = 2115790; //out:156902
//    n = 4974953; // out: 346862
//    cin>>n;
    vector<int> primes;
    bool is_prime[n+1]={0};
    for (int i = 2; i < n+1 ; ++i)
        is_prime[i]=1;
    for (int i = 2; i < n+1; ++i)
    {
        if(is_prime[i])
            primes.push_back(i);
        for (int j = 0; j < primes.size() && primes[j]*i<=n; ++j)
        {
            is_prime[primes[j]*i]=0;
            if(primes[j]%i==0)
                break;
        }
    }
    cout<<primes.size();
    return 0;
}